package com.study.home;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/index")
public class IndexServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //进入首页获取项目名称，配置静态资源
        System.out.println(request.getContextPath());
        request.setAttribute("base",request.getContextPath());
        request.getRequestDispatcher("/index.jsp").forward(request,response);
    }
}
